package com.csdj.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.csdj.entity.Blog;
import com.csdj.mapper.BlogMapper;
import com.csdj.service.IBlogService;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * <p>
 *  服务实现类
 * </p>
 *
 * @author zq
 * @since 2024-12-11
 */
@Service
public class BlogServiceImpl extends ServiceImpl<BlogMapper, Blog> implements IBlogService {

    @Autowired
    private BlogMapper blogMapper;

    @Override
    public Page<Blog> getBlogsByPage(int pageNo, int pageSize) {
        Page<Blog> page = new Page<>(pageNo, pageSize);
        QueryWrapper<Blog> queryWrapper = new QueryWrapper<>();
        return blogMapper.selectBlogByPage(page);
    }
}
